package com.chinasofti.zbest.dao;

import com.chinasofti.zbest.dao.model.UserAddr;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chinasofti.zbest.web.form.UserAddFrom;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 用户地址表 Mapper 接口
 * </p>
 *
 * @author zbest
 * @since 2019-05-28
 */
public interface UserAddrMapper extends BaseMapper<UserAddr> {
    @Select("select u.username,u.user_id,address,is_default,modified_time,user_phone\n" +
            "    from user u,user_addr a\n" +
            "    WHEN u.user_id=a.user_id\n" +
            "    and user_id=#{userid}")
//    List<UserAddFrom> queryAllById(Integer userId);


    List<UserAddr> queryAllByAddrId(@Param("userId")Integer userId);

    UserAddr queryOneUserAddrUn(Integer userId);

    List<UserAddr> findByIdAddr(Integer userId);
}
